package com.yyge.kt.ui.activity

import android.annotation.SuppressLint
import android.view.View
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.yyge.base.BaseActivity
import com.yyge.kt.R
import com.yyge.kt.databinding.ActivityHomeToolbarBinding

class MainActivity : BaseActivity() {
     // lateinit 延迟初始化非空属性
    @SuppressLint("StaticFieldLeak")
    lateinit var binding: ActivityHomeToolbarBinding;


    override fun initUI() {
        // 适配UI
        // enableEdgeToEdge()
        ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        binding.toolbar.inflateMenu(R.menu.menu);
    }

    override fun getLayoutId(): View {
        binding = ActivityHomeToolbarBinding.inflate(layoutInflater)
        return binding.root
    }

}